package com.atguigu.jxc.util;

import java.util.regex.Pattern;

/**
 * @ClassName IntegerUtil
 * @Description
 * @Author junior
 * @Date 2021/9/25 13:25
 */
public class IntegerUtil {
    /**
     * 判断是否为整数
     *
     * @param str : 传入的字符串
     * @return : boolean
     */
    public static boolean isInteger(String str) {
        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
        return pattern.matcher(str).matches();
    }

    /*public static void main(String[] args) {
        System.out.println(isInteger("000a1"));
    }*/
}
